package com.michael.demo.springcloud.alibaba.nacos.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 类功能描述:
 * <pre>
 *   xxxx
 * </pre>
 *
 * @author Michael
 * @version 1.0
 * @date 2021/6/30 15:40
 */
@RefreshScope
@RestController
@RequestMapping("/goods")
public class GoodsController {

    @Value("${goods}")
    private String goods;

    @Value("${price}")
    public String price;

    @Value("${redis}")
    public String redis;

    @GetMapping("/config")
    public String config() {
        return "this goods is " + goods + ", and price is " + price;
    }

    @GetMapping("/redis")
    public String redis() {
        return "this redis is " + redis;
    }
}
